#ifndef __dial_h__
#define __dial_h__ 1
#include "ping.h"
#include "tcp.h"
#include "http.h"
#include "dns.h"
#include "traceroute.h"
#include "tcpping.h"
#include "udpspeed.h"
#include "conn_track.h"

enum {
    TEST_NORMAL_MODE = 0,
    TEST_CAP_MODE,
};

typedef struct {
    int bridge_mode;
    union {
        ping_arg_t ping_arg;
        tcp_arg_t tcp_arg;
        http_arg_t http_arg;
        dns_arg_t dns_arg;
        tr_arg_t tr_arg;
        tcpping_arg_t tcpping_arg;
    } in;
} dial_arg_t;

typedef struct {
    int err;
    union {
        ping_result_t ping_result;
        tcp_result_t tcp_result;
        http_result_t http_result;
        dns_result_t dns_result;
        tr_result_t tr_result;
        tcpping_result_t tcpping_result;
    } out;

} dial_result_t;

typedef void *(*do_fun)(void *arg);
void* dial(do_fun fun, void *arg_in);
void *dial_ping(void *arg);
void *dial_tcp(void *arg);
void *dial_dns(void *arg);
void *dial_http(void *arg);
void *dial_http_download(void *arg);
void *dial_http_upload(void *arg);
void * dial_traceroute(void *arg);
void* dial_tcpping(void* arg);
#endif